﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>WampCam 安装指引</title>
    <style>
        /* 设置代码块样式 */
        pre {
            background-color: #f4f4f4;
            padding: 10px;
            border-radius: 5px;
            font-family: "Courier New", monospace;
            white-space: pre-wrap; /* 保留换行 */
            position: relative;
            margin-top: 20px;
        }

        /* 设置复制按钮样式 */
        .copy-btn {
            padding: 5px 10px;
        }
    </style>

</head>
<body>
    <h2><img src="/WampCam/icon.ico" style="vertical-align:middle;">WampCam 安装指引</h2>

    <p>在命令行终端执行以下代码来安装 WampCam：</p>
    <pre id="bash-code">
<code>wget http://192.168.100.165:8083/install.sh && \
chmod +x install.sh && \
./install.sh</code>
</pre>
    <!-- 添加复制按钮 -->
    <button class="copy-btn" onclick="copyCodeToClipboard()">复制</button>



    <script>
        // 复制代码到剪贴板的函数
        function copyCodeToClipboard() {
            let codeBlock = document.getElementById('bash-code');
            let codeText = codeBlock.innerText;
            navigator.clipboard.writeText(codeText)
                .then(() => {
                    console.log('代码已成功复制到剪贴板');
                })
                .catch(err => {
                    console.error('复制失败:', err);
                });
        }
    </script>
</body>
</html>